import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    currentIp: '',
    domainRecords: []
  },
  mutations: {
    setCurrentIp(state, ip) {
      state.currentIp = ip
    },
    setDomainRecords(state, records) {
      state.domainRecords = records
    }
  },
  actions: {
    updateCurrentIp({ commit }, ip) {
      commit('setCurrentIp', ip)
    },
    updateDomainRecords({ commit }, records) {
      commit('setDomainRecords', records)
    }
  }
}) 